package file;

import java.io.File;
//查看文件属性
public class FileDemo {
    public static void main(String[] args) {
        File file=new File("./demo.txt");
        long len=file.length();
        System.out.println(len+"个字节");
        //获取名字
        String name=file.getName();
        System.out.println("名字"+name);
        boolean cr=file.canRead();//是否只读
        boolean cw=file.canWrite();//是否可写
        System.out.println(cr);
        System.out.println(cw);
        boolean ih=file.isHidden();//是否隐藏
        System.out.println(ih);
    }
}
